import axios from '@/libs/api.request'
import {checkAuth, getToken} from '@/libs/util'


class Role {
  constructor() {
    this.$axios = axios;
  }

  /*
  分页角色
   */
  queryPage = (param) => {
    return axios.request({
      url: '/admin/role/query/page/',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

  queryList = (param) => {
    return axios.request({
      url: '/admin/role/query/list',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'text/html; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

  add = (param) => {
    return axios.request({
      url: '/admin/role/add/',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

  update = (param) => {
    return axios.request({
      url: '/admin/role/update/',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

  remove = (param) => {
    return axios.request({
      url: '/admin/role/delete/',
      method: 'post',
      dataType: 'json',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'token': getToken()
      },
      data: param
    })
  }

}
export default Role;



